from django.conf import settings
from django.shortcuts import render, redirect
from django.views import View

from .utils import *


class Index(View):
    """首页"""

    # def get(self, request):
    #     return render(request, 'index.html')

    def get(self, request):
        """
        展示商品分类
        :param request: index/
        :return:
        """
        data = {
            'categories': get_goods_catetory(),
            'contents': get_adv_info()
        }

        return render(request, 'index.html', data)
        # return redirect(settings.STATIC_URL+'index.html')
